package com.fengye.newscenter.filter;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author fengyexjtu@126.com
 * @since 2024-05-14
 */
@Component
public class WebFilter extends OncePerRequestFilter {
    private static final Logger logger = LoggerFactory.getLogger(WebFilter.class);
    @Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
        logger.info("request.getRequestURI() = {}", request.getRequestURI());
        filterChain.doFilter(request, response);
    }
}
